home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 4 / DATAFILE_PDCD4.iso / utilities / utilsf / jfshared / Modules / TextCopy / AllWCD / Source`v1, < prev    next >
Encoding:
Text File  |  1995-08-10  |  3.4 KB  |  115 lines

  1. App  AllWriteClickDrag
  2. In   -
  3. Out  AllWCD
  4. Type Module
  5. Ver  1.00d
  6. Max  32k
  7.  
  8. Define Workspace
  9.  Name      createiconblock
  10.  Default   r1
  11.  Prefix    ci_
  12.   `window   !   Window handle
  13.   `left     !   left of box
  14.   `bottom   !   bottom of box
  15.   `right    !   right of box
  16.   `top      !   top of box
  17.   `flags    !   icon flags
  18.   `string   !   pointer to string
  19.   `valid    !   pointer to validation
  20.   `len      !   length of string
  21.  Name      basiciconblock
  22.  Default   r2
  23.  Prefix    ib_
  24.   `left     !   left of box
  25.   `bottom   !   bottom of box
  26.   `right    !   right of box
  27.   `top      !   top of box
  28.   `flags    !   icon flags
  29.   `string   !   pointer to string
  30.   `valid    !   pointer to validation
  31.   `len      !   length of string
  32.  Name      windowblock
  33.  Default   r1
  34.  Prefix    cw_
  35.   `left     !   left of VWA
  36.   `bottom   !   bottom of VWA
  37.   `right    !   right of VWA
  38.   `top      !   top of VWA
  39.   `vwaleft  !   VWA in TWA left
  40.   `vwatop   !   VWA in TWA top
  41.   `position !   position in window stack
  42.   `winflags !   window flags
  43.   `cols1    !   first block of colours
  44.   `cols2    !   second block of colours
  45.   `twaleft  !   left of TWA
  46.   `twabottom !   bottom of TWA
  47.   `twaright !   right of TWA
  48.   `tawtop   !   top of TWA
  49.   `tbflags  !   title bar flags
  50.   `tbbut    !   title bar button type
  51.   `sprite   !   sprite area for window
  52.   `reserved !   reserved ?
  53.   `title    $12 title icon
  54.   `numicons !   number of icons
  55.   `icons    ^basiciconblock
  56. End Workspace
  57.  
  58. DEFINE MODULE
  59.  Name    AllWCD
  60.  Help    All Write/Click/Drag
  61.  Version 1.00
  62.  Author  Justin Fletcher
  63.  COMMANDS
  64.   Name   AllWCD
  65.   Help   ...
  66.     The AllWCD module forces all writable icons to be of type 14
  67.     (Write/Click/Drag) rather than type 15 (Write only). The main reason you
  68.     may wish to do this is to force all applications to allow TextCopy to
  69.     drag all writable icons around the desktop.|M
  70.     For best effect, the module should have been loaded BEFORE the desktop
  71.     has started.
  72.  END COMMANDS
  73.  WimpSWIs
  74.    SWI     Wimp_CreateIcon
  75.    Pre     createicon
  76.    SWI     Wimp_CreateWindow
  77.    Pre     createwindow
  78.  End WimpSWIs
  79. END MODULE
  80.  
  81. .createicon
  82.    STMFD   (sp)!,{r0-r5,link}            ; Stack registers
  83.    LDRW    r2,`ci_flags                  ; get the flags
  84.    AND     r0,r2,#&F000                  ; leave just button type
  85.    CMP     r0,#&F000                     ; is it type 15 ?
  86.    LDMNEFD (sp)!,{r0-r5,pc}              ; Return from call if not
  87.    BIC     r2,r2,#&1000                  ; clear bit 12 to leave type 14
  88.    STRW    r2,`ci_flags                  ; store back in block
  89.    LDMFD   (sp)!,{r0-r5,pc}              ; Return from call
  90.  
  91. .createwindow
  92.    STMFD   (sp)!,{r0-r5,link}            ; Stack registers
  93.    LDRW    r5,`cw_numicons               ; get the number of icons
  94.    ADRW    r2,`cw_icons                  ; pointer to icon data
  95. $loop
  96.    CMP     r5,#0
  97.    BLE     $exit
  98.    LDRW    r3,`ib_flags                  ; get the flags
  99.    AND     r0,r3,#&F000                  ; leave just button type
  100.    CMP     r0,#&F000                     ; is it type 15 ?
  101.    BNE     $next                         ; if not then go on to next icon
  102.    BIC     r3,r3,#&1000                  ; clear bit 12 to leave type 14
  103.    STRW    r3,`ib_flags                  ; store back in block
  104. $next
  105.    ADD     r2,r2,#`len_basiciconblock    ; increment position
  106.    SUB     r5,r5,#1                      ; decrement number left
  107.    B       $loop
  108. $exit
  109.    LDMFD   (sp)!,{r0-r5,pc}              ; Return from call
  110.  
  111. # POST
  112. # RUN <CODE>
  113. # END
  114.  
  115.